package com.ciwong.epaper.modules.pigai.util;

import android.app.Activity;
import android.content.Intent;

import com.ciwong.epaper.modules.pigai.ui.EssayRecordDetailH5Activity;
import com.ciwong.epaper.modules.pigai.ui.EssayRecordListH5Activity;
import com.ciwong.epaper.modules.pigai.ui.NewPigaiRecoginzeResultActivity;
import com.ciwong.epaper.modules.pigai.ui.NewWorkPigaiStartActivity;
import com.ciwong.epaper.modules.pigai.ui.PigaiRecoginzeResultActivity;
import com.ciwong.epaper.modules.pigai.ui.PigaiStartActivity;
import com.ciwong.epaper.util.IntentFlag;
import com.ciwong.mobilelib.utils.BaseJumpManager;

/**
 * 批改跳转管理类
 *
 * @author paul
 * @version ciwong v.1.0 2024/11/14 09:10
 * @since ciwong v.1.0
 */
public class PigaiJumpManager extends BaseJumpManager {
    /**
     * 跳转到批改作文界面
     *
     * @param act
     * @param goBackId
     */
    public static void jumpToPigaiStartActivity(Activity act, int goBackId) {
        Intent intent = getBaseIntent(goBackId, act, PigaiStartActivity.class);
        act.startActivity(intent);
    }


    public static void jumpToNewWorkPigaiStartActivity(Activity act, int goBackId) {
        Intent intent = getBaseIntent(goBackId, act, NewWorkPigaiStartActivity.class);
        act.startActivity(intent);
    }

    /**
     * 跳转到选择学校界面
     *
     * @param goBackId    启动activity
     * @param context     将要打开的activity
     * @param requestCode 返回码
     */
    public static void jumpToWrittenTextResult(int goBackId, Activity context,
                                               String answer, int requestCode) {
        Intent intent = getBaseIntent(goBackId, context,
                PigaiRecoginzeResultActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_ANSWER, answer);
        context.startActivityForResult(intent, requestCode);
    }

    public static void jumpToWrittenTextResultNew(int goBackId, Activity context,
                                               String answer, int requestCode) {
        Intent intent = getBaseIntent(goBackId, context,
                NewPigaiRecoginzeResultActivity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_ANSWER, answer);
        context.startActivityForResult(intent, requestCode);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToEssayRecordDetailH5Activity(Activity context,
                                                         int backId, String title, String doWorkId) {
        Intent intent = getBaseIntent(backId, context,
                EssayRecordDetailH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_OBJ, doWorkId);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }

    /**
     * @param context
     * @param backId  R.string.go_back
     * @param title   标题
     */
    public static void jumpToEssayRecordListH5Activity(Activity context,
                                                       int backId, String title) {
        Intent intent = getBaseIntent(backId, context,
                EssayRecordListH5Activity.class);
        intent.putExtra(IntentFlag.INTENT_FLAG_TITLE, title);
        context.startActivity(intent);
    }
}
